package com.online.websocketcluster;

import com.online.websocketcluster.util.HbUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 *  WebSocket 链路层集群入口
 * @author hsc
 */
@EnableDiscoveryClient
@SpringBootApplication
@EnableFeignClients
@MapperScan("com.online.websocketcluster.dao")
//@EnableHystrix//添加断路器的注解
@EnableCircuitBreaker
//@EnableHystrixDashboard//添加断路器监控注解
public class WebsocketClusterApplication {

    public static void main(String[] args) {

        SpringApplication.run(WebsocketClusterApplication.class, args);

        /**
         * 开启心跳机制线程
         */
//        ThreadPoolExecutor executor = new ThreadPoolExecutor(5, 10, 200, TimeUnit.MILLISECONDS,
//                new ArrayBlockingQueue<Runnable>(5));
//
//            HbUtils hbUtils = new HbUtils();
//            executor.execute(hbUtils);
//            executor.shutdown();
        new  Thread(new HbUtils()).start();


    }

}
